package com.wj.dubbo.service.welfareshop.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldIndex;
import org.springframework.data.elasticsearch.annotations.FieldType;

import com.fasterxml.jackson.annotation.JsonFormat;


/**   
 * 类名称：Product
 * 类描述 ：商品详情请求结果集
 * 创建人; Administrator  
 * 创建时间：2017-4-25 下午2;31;16  
 * 修改人：
 * 修改时间：
 * 修改备注：
 * 版本： V1.0
 */
@Document(indexName = "es_welfareshop", type = "product")
public class Product implements Serializable{
	 private static final long serialVersionUID = 1L;
	 @Id
	 private Integer id;
	 
	 @Field(type = FieldType.Integer)    
	 private Integer productId;//商品ID
	 
	 @Field(type = FieldType.String, analyzer="ik",searchAnalyzer = "ik")    
	 private String name; //商品名称
	 
	 @Field(type = FieldType.String) 
	 private String type; //产品来源(system: 系统, provider:供应商)
	 
	 @Field(type = FieldType.String)    
	 private String thumbnailImage; //商品缩略图， 主要用于商品列表展示
	 
	 @Field(type = FieldType.String,analyzer="ik", searchAnalyzer = "ik")    
	 private String brand; //品牌名称
	 
	 @Field(type = FieldType.String)    
	 private String productCate; //商品分类
	 
	 @Field(type = FieldType.String,analyzer="ik", searchAnalyzer = "ik")    
	 private String productCode;//商品型号
	 
	 @Field(type = FieldType.String)
	 private String status; //商品状态 (selling: 上架销售中, undercarriage: 下架)
	 
	 private BigDecimal marketPrice; //商品市场价
	 
	 private BigDecimal retailPrice; //协议价格(系统结算价格)
	 
	 @Field(type = FieldType.String, analyzer="ik",searchAnalyzer = "ik")    
	 private String productPlace;//商品产地
	 
	 @Field(type = FieldType.String,analyzer="ik", searchAnalyzer = "ik")    
	 private String features; //商品描述信息（简要描述）
	 
	 @Field(type = FieldType.Boolean)    
	 private Boolean hot;//是否为热销商品
	 
	 @Field(type = FieldType.String)   
	 private String createTime; //商品创建时间, 格式yyyy-MM-dd HH:mm:ss
	 
	 @Field(type = FieldType.String,analyzer="ik", searchAnalyzer = "ik")    
	 private String description;//商品详情信息（图文说明信息， 包含HTML代码）
	 
	 @Field(type = FieldType.Nested)    
	 private List<Image> images; //商品图片
	 
	 @Field(type = FieldType.String)    
	 private String rootCate;//一级分类code
	 
	 @Field(type = FieldType.String)    
	 private String twoCate;//二级分类code
	 
	 @Field(type = FieldType.String)    
	 private String threeCate;//三级分类code
	 
	 @JsonFormat(pattern="yyyy-MM-dd'T'HH:mm:ssZ")
	 @Field(type = FieldType.Date, index = FieldIndex.not_analyzed, store = true)
	 private Date createDate; //商品创建时间, 格式yyyy-MM-dd HH:mm:ss
	
	public Integer getProductId() {
		return productId;
	}
	public void setProductId(Integer productId) {
		this.productId = productId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public String getThumbnailImage() {
		return thumbnailImage;
	}
	public void setThumbnailImage(String thumbnailImage) {
		this.thumbnailImage = thumbnailImage;
	}
	public String getBrand() {
		return brand;
	}
	public void setBrand(String brand) {
		this.brand = brand;
	}
	public String getProductCate() {
		return productCate;
	}
	public void setProductCate(String productCate) {
		this.productCate = productCate;
	}
	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public BigDecimal getMarketPrice() {
		return marketPrice;
	}
	public void setMarketPrice(BigDecimal marketPrice) {
		this.marketPrice = marketPrice;
	}
	public BigDecimal getRetailPrice() {
		return retailPrice;
	}
	public void setRetailPrice(BigDecimal retailPrice) {
		this.retailPrice = retailPrice;
	}
	public String getProductPlace() {
		return productPlace;
	}
	public void setProductPlace(String productPlace) {
		this.productPlace = productPlace;
	}
	public String getFeatures() {
		return features;
	}
	public void setFeatures(String features) {
		this.features = features;
	}
	public Boolean getHot() {
		return hot;
	}
	public void setHot(Boolean hot) {
		this.hot = hot;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public List<Image> getImages() {
		return images;
	}
	public void setImages(List<Image> images) {
		this.images = images;
	}
	
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) throws ParseException {
		this.createDate = createDate;
	}
	public String getRootCate() {
		return rootCate;
	}
	public void setRootCate(String rootCate) {
		this.rootCate = rootCate;
	}
	public String getTwoCate() {
		return twoCate;
	}
	public void setTwoCate(String twoCate) {
		this.twoCate = twoCate;
	}
	public String getThreeCate() {
		return threeCate;
	}
	public void setThreeCate(String threeCate) {
		this.threeCate = threeCate;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@Override
	public String toString() {
		return "Product [productId=" + productId + ", name=" + name + ", type="
				+ type + ", thumbnailImage=" + thumbnailImage + ", brand="
				+ brand + ", productCate=" + productCate + ", productCode="
				+ productCode + ", status=" + status + ", marketPrice="
				+ marketPrice + ", retailPrice=" + retailPrice
				+ ", productPlace=" + productPlace + ", features=" + features
				+ ", hot=" + hot + ", createTime=" + createTime
				+ ", description=" + description + ", createDate=" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createDate)
				+ " rootCate=" + rootCate +  ", twoCate=" + twoCate + ", threeCate=" + threeCate;
	}
	 
	
}
